โ† Back to Frontend System Design Blogs

Non-Functional Requirements

2025-06-19๐Ÿ“– 3 min read

Share:

โš™๏ธ Step 2: Non-Functional Requirements โ€“ E-commerce App

Beyond features, a good frontend system is defined by its quality attributes โ€” how fast, accessible, secure, and maintainable it is.

Here are the key non-functional goals for our Angular-based e-commerce store:

๐Ÿš€ Performance

  • Use lazy loading for feature modules like cart, wishlist, and checkout.
  • Apply OnPush change detection to optimize rendering.

๐Ÿ“ฑ Responsiveness

  • Implement a mobile-first layout with CSS Flex/Grid.
  • Use Angularโ€™s BreakPointObserver if needed for dynamic layouts.

๐Ÿ”’ Security

  • Avoid XSS using Angular's built-in sanitization.
  • Protect routes with guards (auth, roles).
  • Store JWT securely (prefer HttpOnly cookie strategy).

โ™ฟ Accessibility

  • Follow WCAG 2.1 guidelines.
  • Use ARIA labels and proper semantic HTML.
  • Ensure full keyboard navigation (especially for product filters and checkout forms).

These NFRs guide every future design decision โ€” from component strategy to folder structure, from routing to testing.

๐Ÿงฑ Reliability

  • Graceful fallback UIs for failed API calls (e.g., show error messages, retry options, empty state UI).
  • Use RxJS retry/backoff patterns for network resilience where appropriate.
  • Critical flows like checkout, cart updates, and login include optimistic updates with rollback handling.
  • Monitor key events via custom error handlers and global interceptors.
  • Detect and alert runtime errors using tools like Sentry, Firebase Crashlytics, or custom logging.

๐Ÿงช Combine with testing strategy to catch regressions early and ensure uptime through reliable user experiences.

๐Ÿ“ˆ Scalability

  • Modular architecture using feature-based folders (e.g., /products, /cart, /orders) allows easy onboarding of new features.
  • State is managed centrally using NgRx or locally via Signals, enabling distributed development and horizontal scaling.
  • Feature modules are lazy loaded, ensuring performance even as the app grows.
  • Ready for micro frontends if needed in the future (e.g., separate admin panel, product engine, etc.).

๐Ÿ› ๏ธ Maintainability

  • Uses DRY (Don't Repeat Yourself) principles via shared components, pipes, and services.
  • Follows Angular style guide: consistent naming, smart/dumb component separation, clear folder structure.
  • Includes CoreModule for singleton services and SharedModule for UI elements to reduce duplication.
  • Encourages single responsibility principle (SRP) for services and components.

๐Ÿงช Testing Strategy

Layer Approach Tooling
Unit Testing Pure component/service logic Karma + Jasmine
Integration Component with DOM interactions Angular Testing Utils
E2E Testing Simulated user flows Cypress or Playwright
  • Write unit tests for every service and pipe.
  • Cover component outputs and user interactions via integration tests.
  • Run E2E tests for cart, checkout, and auth flows.
  • Use TestBed for isolation and mocking dependencies.

๐Ÿ” Automated testing in CI pipelines is recommended for consistent build verification.


โœ… These additions ensure that your e-commerce frontend isnโ€™t just feature-complete, but also engineered to last โ€” flexible to scale, easy to modify, and reliable in real-world use.